@echo off

set INCLUDE=C:\Program Files\Microsoft SDK\include;%INCLUDE%
set LIB=C:\Program Files\Microsoft SDK\lib;%LIB%

@echo off
if not exist "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" goto error
call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

set WXWIN=%CD%
if not exist "%WXWIN%\build\msw\makefile.vc" goto error

if not exist "%WXWIN%\include\wx\msw\setup0.h" goto setup_error
copy /y "%WXWIN%\include\wx\msw\setup0.h" "%WXWIN%\include\wx\msw\setup.h"
if not exist "%WXWIN%\include\wx\msw\setup.h" goto setup_error

PUSHD build\msw
call :make

cd ..\..\samples
call :make

cd ..\demos
call :make

cd ..\utils
call :make

POPD

goto done
:error
echo WXWIN is not properly set
goto done
:setup_error
echo setup.h cannot be found, wrong working directory?
:done
GOTO :EOF

@REM Perform builds with all desired configurations
:make
@REM x86 debug & release multiple DLLs Unicode
nmake -f makefile.vc MONOLITHIC=0 SHARED=1 UNICODE=1 WXUNIV=0 BUILD=debug VENDOR=sui
nmake -f makefile.vc MONOLITHIC=0 SHARED=1 UNICODE=1 WXUNIV=0 BUILD=release VENDOR=sui

@REM x86 debug & release multiple static libs Unicode
nmake -f makefile.vc MONOLITHIC=0 SHARED=0 UNICODE=1 WXUNIV=0 BUILD=debug VENDOR=sui
nmake -f makefile.vc MONOLITHIC=0 SHARED=0 UNICODE=1 WXUNIV=0 BUILD=release VENDOR=sui

@REM x86 debug & release multiple wxUniversal DLLs Unicode
nmake -f makefile.vc MONOLITHIC=0 SHARED=1 UNICODE=1 WXUNIV=1 BUILD=debug VENDOR=sui
nmake -f makefile.vc MONOLITHIC=0 SHARED=1 UNICODE=1 WXUNIV=1 BUILD=release VENDOR=sui

@REM x86 debug & release multiple wxUniversal static libs Unicode
nmake -f makefile.vc MONOLITHIC=0 SHARED=0 UNICODE=1 WXUNIV=1 BUILD=debug VENDOR=sui
nmake -f makefile.vc MONOLITHIC=0 SHARED=0 UNICODE=1 WXUNIV=1 BUILD=release VENDOR=sui

@REM x86 debug & release multiple wxUniversal static libs Unicode
nmake -f makefile.vc MONOLITHIC=0 SHARED=0 UNICODE=1 WXUNIV=1 BUILD=debug VENDOR=sui
nmake -f makefile.vc MONOLITHIC=0 SHARED=0 UNICODE=1 WXUNIV=1 BUILD=release VENDOR=sui